package com.yizhuoyan.his.webapi.controller.admin.vo;

import com.yizhuoyan.his.entity.SysAccountEntity;
import lombok.Data;

import java.time.LocalDateTime;

@Data
public class SysAccountVo {
    /**
     * ID主键
     */
    private Long id;
    /**
     * 帐号（登录名）
     */
    private String account;
    /**
     * 帐号昵称
     */
    private String nickname;
    private Long roleId;
    private LocalDateTime createTime;
    private LocalDateTime lastUpdatePasswordTime;
    private LocalDateTime lastLoginTime;
    public static SysAccountVo of(SysAccountEntity e){
        if(e==null)return null;
        SysAccountVo vo=new SysAccountVo();
        vo.setId(e.getId());
        vo.setAccount(e.getAccount());
        vo.setNickname(e.getNickname());
        vo.setRoleId(e.getRoleId());
        vo.setCreateTime(e.getCreateTime());
        vo.setLastLoginTime(e.getLastLoginTime());
        vo.setLastUpdatePasswordTime(e.getLastUpdatePasswordTime());
        return vo;
    }
}
